package com.zhang.sparktool.utils;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * @author: ZhangGuowen
 * @Title: PropertiesUtils
 * @ProjectName: spark-datases-compare
 * @Description:
 * @date: 2021/7/20 16:43
 */
public class PropertiesUtils {

    public static Properties getProperties() throws IOException {
        Properties properties = new Properties();
        // 使用ClassLoader加载properties配置文件生成对应的输入流
        InputStream in = PropertiesUtils.class.getClassLoader().getResourceAsStream("/config.properties");
        // 使用properties对象加载输入流
        properties.load(in);
        return properties;
    }

}
